import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)

export default new Router({
  //mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      redirect: '/login',
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import('./views/Login.vue')
    },
    {
      path: '/about',
      name: 'About',
      component: () => import('./views/About.vue')
    },
    {
      path: '/map',
      name: 'Map',
      component: () => import('./views/Map.vue')
    },
    {
      path: '/register',
      name: 'Register',
      component: () => import('./views/Register.vue')
    },
    {
      path: '/forgetpassword',
      name: 'ForgetPassword',
      component: () => import('./views/ForgetPassword.vue')
    },
    {
      path: '/index',
      name: 'Index',
      redirect:'/index/home',
      component: () => import('./views/Index.vue'),
      children:[
        {
          path: 'home',
          component: () => import('./views/Home.vue'),
        },
        {
          path: 'personalCenter',
          component: () => import('./views/PersonalCenter.vue'),
        },
        {
          path: 'editregister',
          component: () => import('./views/EditRegister.vue'),
        },
        {
          path: 'shoppingCart',
          //name: 'ShoppingCart',
          component: () => import('./views/ShoppingCart.vue')
        },
        {
          path: 'logisticsInformation',
          component: () => import('./views/LogisticsInformation.vue')
        },
        {
          path: 'order',
          component: () => import('./views/Order.vue')
        },
        {
          path: 'address',
          component: () => import('./views/Address.vue')
        },
        {
          path: 'pay',
          component: () => import('./views/Pay.vue'),
        },
        {
          path: 'signOut',
          component: () => import('./views/SignOut.vue'),
        },
        {
          path: 'error',
          component: () => import('./views/error.vue'),
        },
      ]
    },
  ]
})
